﻿<UserControl x:Class="EasySL.UI.Controls.Diagrams"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:my="clr-namespace:EasySL.UI.Controls"          
    >
    <Grid x:Name="LayoutRoot" Background="#FFF5F5F5">
        <Grid.Resources>
            <my:City x:Key="City"></my:City>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="250"></RowDefinition>
            <RowDefinition Height="250"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="400"></ColumnDefinition>
            <ColumnDefinition Width="400"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <charting:Chart Grid.Row="0"  Grid.Column="0" Title="Pie Legend" BorderBrush="White">
            <charting:Chart.Series>
                <charting:PieSeries x:Name="pie"
                                        ItemsSource="{Binding PugetSound, Source={StaticResource City}}"
                                        IndependentValueBinding="{Binding Name}"
                                        DependentValueBinding="{Binding Population}"
                                />
            </charting:Chart.Series>
        </charting:Chart>
        <charting:Chart Grid.Row="0"  Grid.Column="1" Title="Column Legend" BorderBrush="White">
            <charting:Chart.Series>
                <charting:ColumnSeries x:Name="column" Title="Population"
                                        ItemsSource="{Binding PugetSound, Source={StaticResource City}}"
                                        IndependentValueBinding="{Binding Name}"
                                        DependentValueBinding="{Binding Population}"
                                />
            </charting:Chart.Series>
        </charting:Chart>

        <charting:Chart Grid.Row="1"  Grid.Column="0" Title="Line Legend" BorderBrush="White">
            <charting:Chart.Series>
                <charting:LineSeries x:Name="line" Title="Rainfall"
                                        ItemsSource="{Binding PugetSound, Source={StaticResource City}}"
                                        IndependentValueBinding="{Binding Rainfall}"
                                        DependentValueBinding="{Binding Population}"
                                />
            </charting:Chart.Series>
        </charting:Chart>
        <charting:Chart Grid.Row="1"  Grid.Column="1" Title="Scatter Legend" BorderBrush="White">
            <charting:Chart.Series>
                <charting:ScatterSeries x:Name="scatter" Title="Particulate"
                                        ItemsSource="{Binding PugetSound, Source={StaticResource City}}"
                                        IndependentValueBinding="{Binding Rainfall}"
                                        DependentValueBinding="{Binding Population}"
                                />
            </charting:Chart.Series>
        </charting:Chart>
    </Grid>
</UserControl>
